<?php

class Shop extends Module
{
	function __construct ($db){
		$this->set_db($db);
	}

	function get_all_shop(){
		return $this->get_all("shop");
	}

	function get_shop($gid){
		$result = $this->get("shop", "gid='$gid'");

		$result["shop_th"] = nl2br($result["shop_th"]);
		$result["shop_en"] = nl2br($result["shop_en"]);
		$result["detail_th"] = nl2br($result["detail_th"]);
		$result["detail_en"] = nl2br($result["detail_en"]);
		
		 return $result;
	}

	function get_min(){
		return $this->db->minOf("gid","shop",1);
	}

	function get_all_picture($gid){
		return $this->get_all("shop_picture", "gid='$gid'");
	}
}

?>